package com.qf.test;

import java.math.BigInteger;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;

/**
 * @author Ypl
 * @version V1.0
 * @Project September
 * @Package com.qf.test
 * @Description:
 * @Date 2022/9/11 9:52
 */
@SuppressWarnings("all")
public class Tesat {
    public static void main(String[] args) {
//        这是一个MD5转换
        String md5String = getMD5String("123456");
        System.out.println(md5String);

    }

    public  static String getMD5String(String str){
        try {
            MessageDigest md5 = MessageDigest.getInstance("MD5");
            md5.update(str.getBytes());

            return new BigInteger(1, md5.digest()).toString(16);
        } catch (NoSuchAlgorithmException e) {
            e.printStackTrace();
            return null;
        }
    }
}
